<template>
  <div class="class-list">
    <ul>
      <li class="listitem" v-for="(item,index) in $store.state.singerClass"
          :key="index">
        <img :src="item.picUrl" alt="">
        <span>{{item.name}}</span>
        <div class="head">
          <img src="../../../assets/img/singer/head.svg" alt="">
        </div>
        <div class="follow" @click="clickFollow(index)">
          <p>+ 关注</p>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
    export default {
        name: "ClassList",
        methods:{
            clickFollow(index){
                console.log(this.$store.state.singerClass[index].name + 'click the follow me!')
            },
        },
    }
</script>

<style scoped>

  .class-list{
    width: 100%;
  }

  ul li{
    list-style: none;
  }

  .listitem{
    display: flex;
    margin-left: 10px;
    margin-top: 20px;
  }

  .listitem img{
    width: 70px;
    height: 70px;
    border-radius: 35px;
    border: 3px solid #DB2C1F;
  }

  .listitem span{
    line-height: 70px;
    margin-left: 20px;
  }

  .head{
    line-height: 70px;
    margin-left: 20px;
    flex: 1;
  }

  .head img{
    width: 15px;
    height: 15px;
    vertical-align: middle;
  }

  .follow{
    height: 20px;
    width: 60px;
    text-align: center;
    line-height: 20px;
    border-radius: 15px;
    color: red;
    border: 1px solid red;
    margin-right: 10px;
    margin-top: 25px;
  }

  .follow p{

  }





</style>